package com.cmsz.uregs.controllers;

import javax.servlet.http.HttpSession;

import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class SessionController {
	@RequestMapping(value = "adminsession", method = RequestMethod.GET)
	public String getQx(HttpSession session) {
		String qx = session.getAttribute("qx") == null ? "0" : (String) session.getAttribute("qx");
		return qx;
	}

	@RequestMapping(value = "usersession", method = RequestMethod.GET)
	public String getUsername(HttpSession session) {
		String username = session.getAttribute("username") == null ? "" : (String) session.getAttribute("username");
		return username;
	}
}
